import {
	Server
} from '@/utils/Server/index.js'

//3.3 申请退款
export const refund = (data) => {
	return Server({
		url: '/miniapp/order/v2/apply-refund',
		method: 'put',
		data
	})
}
// 4.4.10 获取骑手位置
export const track = (data) => {
	return Server({
		url: '/miniapp/order/v2/order-deliver-track',
		method: 'get',
		data
	})
}
// 4.4.9 退款详情
export const refunddetail = (data) => {
	return Server({
		url: '/miniapp/order/v2/order-refund-detail',
		method: 'get',
		data
	})
}
// 4.4.7 提交订单
export const orderpay = (data) => {
	return Server({
		url: '/miniapp/order/v2/order-pay',
		method: 'post',
		data
	})
}
// 2.9 会员订单修改地址
export const changeaddress = (data) => {
	return Server({
		url: '/miniapp/mall/v1/order/change-address',
		method: 'post',
		data
	})
}
// 4.4.6 预下单 
export const createorder = (data) => {
	return Server({
		url: '/miniapp/order/v2/order/pre-create-order',
		method: 'post',
		data
	})
}
// 4.4.5 删除订单
export const delorder = (data) => {
	return Server({
		url: '/miniapp/order/v2/order',
		method: 'delete',
		data
	})
}
//4.4.4 修改订单信息
export const editorderd = (data) => {
	return Server({
		url: '/miniapp/order/v2/order',
		method: 'put',
		data
	})
}
//2.5立即支付
export const newpay = (data) => {
	return Server({
		url: '/miniapp/mall/v1/order/pay',
		method: 'post',
		data
	})
}

// 2.4再来一单
export const orderagain = (data) => {
	return Server({
		url: '/miniapp/v1/orders/order/order-again',
		method: 'post',
		data
	})
}


//4.4.3 取消订单
export const ordercancel = (data) => {
	return Server({
		url: '/miniapp/order/v2/order-cancel',
		method: 'put',
		data
	})
}

// 4.4.2 订单详情
export const oredrDitils = (data) => {
	return Server({
		url: '/miniapp/order/v2/order',
		method: 'get',
		data
	})
}
// 4.4.1 订单列表
export const oredrlist = (data) => {
	return Server({
		url: '/miniapp/order/v2/orders',
		method: 'get',
		data
	})
}

// 4.4.8 立即付款-余额支付
export const balancePay = (data) => {
	return Server({
		url: '/miniapp/order/v2/pay-balance',
		method: 'post',
		data
	})
}


// 2.9 会员订单修改地址
export const changeAddress = (data) => {
	return Server({
		url: '/miniapp/mall/v1/order/change-address',
		method: 'post',
		data
	})
}

//4.4.13 查看购物车 
export const storecartdetals = (data) => {
	return Server({
		url: '/miniapp/order/v2/cart',
		method: 'get',
		data
	})
}

//4.4.15 清空购物车
export const deleteGoods = (data) => {
	return Server({
		url: '/miniapp/order/v2/cart',
		method: 'delete',
		data
	})
}

//4.1.6.2 获取是否是会员
export const isVip = (data) => {
	return Server({
		url: '/miniapp/member/v2/is-shop-vip',
		method: 'get',
		data
	})
}

//4.4.17 完成订单
export const orderOver = (data) => {
	return Server({
		url: '/miniapp/order/v2/order-over',
		method: 'put',
		data
	})
}

//4.4.18 配送日志
export const deliverRecords = (data) => {
	return Server({
		url: '/miniapp/order/v2/order-deliver-records',
		method: 'get',
		data
	})
}
///miniapp/order/v2/pay
export const weChatpay = (data) => {
	return Server({
		url: '/miniapp/order/v2/pay',
		method: 'post',
		data
	})
}